package com.cctc.rds.nrpc.core.protocol.codec;

import com.cctc.rds.nrpc.core.protocol.message.Message;
import com.cctc.rds.nrpc.core.protocol.serializer.SerializerType;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import io.netty.handler.codec.MessageToMessageEncoder;

import java.util.List;

public class MessageEncode extends MessageToByteEncoder<Message> {
    @Override
    protected void encode(ChannelHandlerContext ctx, Message msg, ByteBuf out) throws Exception {
        MessageCodecManager.encode(out, msg, SerializerType.JSON);
    }
}
